package edu.neusoft.springhtmldemo.controller;

import edu.neusoft.springhtmldemo.domain.RobotManagement;
import edu.neusoft.springhtmldemo.service.RobotManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RobotManagementController {
    @Autowired
    private RobotManagementService service;

    @RequestMapping("robotmanagementShow")
    public List<RobotManagement> robotmanagementShow(){
        List<RobotManagement> list=service.showAll();
        return list;
    }

    @RequestMapping("selectRobotManagement")
    public List<RobotManagement> selectRobotManagement(RobotManagement management){
        List<RobotManagement> list=service.selectRobotManagement(management);
        return list;
    }

    @RequestMapping("updateRobotManagement")
    public void updateRobotManagement(RobotManagement management){
//        System.out.println(management);
        service.updateRobotManagement(management);
    }

    @RequestMapping("robotNumValues")
    public List<String> robotNumValues(){
        return service.robotNumValues();
    }

    @RequestMapping("addRobotManagementTables")
    public void addRobotManagementTables(RobotManagement management){
        System.out.println(management);
        service.addRobotManagementTables(management);
    }

    @RequestMapping("delRobotManagementTables")
    public void delRobotManagementTables(RobotManagement management){
        service.delRobotManagementTables(management);
    }
}
